This is Info file ../info/hm--html-mode.info, produced by Makeinfo
version 1.68 from the input file hm--html-mode.texi.
This file documents the Elisp package `hm--html-menus'.
Copyright (C) 1997 Heiko Mⁿnkel
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "Distribution" and "General Public License"
are included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "Distribution" and "General
Public License" may be included in a translation approved by the author
instead of in the original English.
File: hm--html-mode.info, Node: Defining The Drag And Drop Actions, Next: The Mouse Bindings, Prev: Drag And Drop Customization, Up: Drag And Drop Customization
Defining The Drag And Drop Actions
----------------------------------
The drag and drop actions are commands which are called after an
internal drag and drop. They depend on the source and the destination
of the drag and drop. Drag and drop actions are defined by the variable:
* `idd-actions': A list with actions, depending on the source and the
File: hm--html-mode.info, Node: The Mouse Bindings, Next: The Drag And Drop Mouse Pointer, Prev: Defining The Drag And Drop Actions, Up: Drag And Drop Customization
The Mouse Bindings
------------------
The following three variables determine the mouse bindings and the
mouse behaviour for the internal drag and drop package:
* `idd-global-mouse-keys': The mouse keys for the command
`idd-mouse-drag-and-drop'. The command `idd-mouse-drag-and-drop'
is bound during the loading of the package
`internal-drag-and-drop' to these keys in the global keymap. The
drag and drop action must be bound global, because the drag and
drop action must be started by a click in the source buffer.
Therefore no action will be performed if the mouse keys are not
bound to `idd-mouse-drag-and-drop' in the destination buffer.
Set it to `nil', if you don't want to bind this function during
loading.
If the command is already bound in the global keymap during
loading, then this key sequence will not be bound.
By default the mouse binding is <meta> <control> <button1>.
* `idd-global-help-mouse-keys': The mouse keys for the command
`idd-help-mouse-drag-and-drop'. The command
`idd-help-mouse-drag-and-drop' is bound during the loading of the
package `internal-drag-and-drop' to these keys in the global
keymap.
Set it to `nil' if you don't want to bind this function during
loading.
If the command is already bound in the global keymap during
loading, then this key sequence will not be bound.
By default the mouse binding is <meta> <control> <button3>.
* `idd-drag-and-drop-mouse-binding-type': The type of the drag and
drop mouse binding. The value may be `click' or
`press-button-during-move'. A value of `click' means that you
have to click over the source, release the button and click it
again over the destination. A value of `press-button-during-move'
means that you have to press the button down over the source and
hold it until the mouse pointer is over the destination.
The *disadvantage* of the `press-button-during-move' type compared
with the `click' type is that you can't select a destination
region, and therefore a drag and drop action depending on a
selected region can't be started with that type of mouse binding.
File: hm--html-mode.info, Node: The Drag And Drop Mouse Pointer, Prev: The Mouse Bindings, Up: Drag And Drop Customization
The Drag And Drop Mouse Pointer
-------------------------------
In the XEmacs the mouse pointer glyph (shape) can be set to any
glyph. This is used during the drag and drop command to indicate, that
the command is active. There exists the following three variables to
customize this:
* `idd-mouse-pointer-image': The name of the xbm file with the mouse
pointer image. By default this is the file `drop'. There exists
also a file called `dropmsk', which contains the mask image. The
mask file is loaded automaticly.
* `idd-data-directory': The name fo the directory, where the file
`idd-mouse-pointer-image' is searched. By default this is the
subdirectory `idd' in the XEmacs install directory
`data-directory'.
* `idd-overwrite-mouse-pointers': A list with pointer glyph
variables, which should be overwritten by the
`idd-drag-and-drop-pointer-glyph'. If it is nil, the pointer wont
be changed. Currently it must be nil in the Emacs.
If one of the variables `idd-mouse-pointer-image' or
`idd-data-directory' is changed, the command
`idd-make-drag-and-drop-pointer-glyph' must be called. This command
builds the mouse pointer glyph, which is stored in
`idd-drag-and-drop-pointer-glyph'.
I don't know how to set the the mouse pointer in the Emacs to a drag
and drop image. Any hints for doing this are welcome.
File: hm--html-mode.info, Node: The Drag And Drop Commands, Prev: Drag And Drop Customization, Up: Internal Drag And Drop
The Drag And Drop Commands
==========================
There are 2 groups of commands. The first contains commands which
perform the drag and drop action and the second displays help messages
about a possible drag and drop action.
* Menu:
* Performing The Drag And Drop Action::
* Displaying Help On Drag And Drop::
File: hm--html-mode.info, Node: Performing The Drag And Drop Action, Next: Displaying Help On Drag And Drop, Prev: The Drag And Drop Commands, Up: The Drag And Drop Commands
Performing The Drag And Drop Action
-----------------------------------
The following five commands perform internal drag and drop actions:
* `idd-mouse-drag-and-drop': Performs a drag and drop action. It
calls the command `idd-mouse-drag-and-drop-click' or
`idd-mouse-drag-and-drop-press-button-during-move' depending on the
value of `idd-drag-and-drop-mouse-binding-type'. However you've set
this, you start a drag and drop action with this command by
pressing down its mouse button over the source. This command is
bound by default to a global mouse key sequence. *Note The Mouse
Bindings::.
* `idd-start-mouse-drag-and-drop': Starts a drag and drop command.
This command could be used to start a drag and drop command
without a button event. Therefore this should not be bound
directly to a mouse button. This command can be used to start a
drag and drop action with a click on a menu item or tool bar icon.
After that you have to press a mouse button over the source. The
rest depends on the value of
`idd-drag-and-drop-mouse-binding-type', as with the command
`idd-mouse-drag-and-drop'.
* `idd-help-start-action': It is possible to display a help buffer
with a message in it, which describes the action instead of
performing it immediately (*note Displaying Help On Drag And
Drop::.). In this case you can perform the action by clicking on a
special extent in the help buffer, which runs this command.
* `idd-mouse-drag-and-drop-press-button-during-move': Performs a drag
and drop action in a more traditional way than
`idd-mouse-drag-and-drop-click'. First you press the button over
the source and then move with the depressed button to the
destination, where you release the button. This must be bound to a
mouse button. The `SOURCE-EVENT' must be a `button-press-event'.
The disadvantage of this command compared with the command
`idd-mouse-drag-and-drop-click' is, that you can't select a
destination region.
You should bind the command `idd-mouse-drag-and-drop' instead of
this one, because it's then possible to switch between both drag
and drop behaviours by changing only one variable.
* `idd-mouse-drag-and-drop-click': Performs a drag and drop action in
a more useful way than
`idd-mouse-drag-and-drop-press-button-during-move'. First you
click on the source and then on the destination. This must be
bound to a mouse button. The `SOURCE-EVENT' must be a
`button-press-event'.
You should bind the command `idd-mouse-drag-and-drop' instead of
this one, because it's then possible to switch between both drag
and drop behaviours by changing only one variable.
File: hm--html-mode.info, Node: Displaying Help On Drag And Drop, Prev: Performing The Drag And Drop Action, Up: The Drag And Drop Commands
Displaying Help On Drag And Drop
--------------------------------
It's possible to display a buffer with a help message describing the
action being considered before actually performing it. To perform the
action, you then click on a special extent in the help buffer. To get
the help buffer, you do the same things as you do to perform the action
itself. Only the mouse key differs. There are two commands for this:
* `idd-help-mouse-drag-and-drop': Displays help about the drag and
drop action. It works similarly to `idd-mouse-drag-and-drop'
(*note Performing The Drag And Drop Action::.).
By default this command is globally bound to <meta> <control>
<button3>. This may be changed with the variable
`idd-global-help-mouse-keys' (*note The Mouse Bindings::.).
* `idd-start-help-mouse-drag-and-drop': Starts displaying help about
the drag and drop action. It works similarly to
`idd-start-mouse-drag-and-drop' (*note Performing The Drag And
Drop Action::.) and can be used to start the help by clicking on a
menu item or a tool bar icon.
File: hm--html-mode.info, Node: Template Minor Mode, Next: Hints For Emacs 19 Users, Prev: Internal Drag And Drop, Up: Top
Template Minor Mode
*******************
There's a file called `tmpl-minor-mode.el' in the distribution of
the package *hm--html-menus*. It provides functions to use templates
for the `hm--html-mode' and also for other modes. It needs nothing from
the rest of the package and therefore it can be used independently of
`hm--html-mode'.
* Menu:
* What Are Templates::
* Syntax Of Templates::
* Template Customization::
* Template Commands::
File: hm--html-mode.info, Node: What Are Templates, Next: Syntax Of Templates, Prev: Template Minor Mode, Up: Template Minor Mode
What Are Templates
==================
Templates are special pieces of text, which can be expanded by
emacs. Expansion means that the template is replaced by something else,
determined by evaluating lisp forms or emacs commands. The expansion
can be done automatically after the insertion of templates with the
command `tmpl-insert-template-file' in a buffer or by hand with the
commands `tmpl-expand-templates-in-buffer' or
`tmpl-expand-templates-in-region'.
Templates can be put together with normal text in a so called
template file to provide prototype files. You should name these files
with the following naming scheme:
<FILE>.<TYPE>.tmpl
where <FILE> is a string which describes for what the template could
be used and <TYPE> the normal file extension, e.g. `c' for C- files or
`html' for HTML- files.
File: hm--html-mode.info, Node: Syntax Of Templates, Next: Template Customization, Prev: What Are Templates, Up: Template Minor Mode
Syntax Of Templates
===================
The templates are marked with the sign ^@, which stands for the null
character (\000). It can be inserted in a buffer with the keys `C-q
C-SPC'. You can also use any other character or string of characters by
changing the variable `tmpl-sign'.
At the moment, there are 3 major types of templates:
1. *Emacs Lisp function templates*: The expansion of such a template
evals a lisp form. It is possible to use functions or variables as
lisp forms. The following is a simple example:
^@LISP^@ (insert-file "~/.emacs") ^@END LISP^@
inserts the contents of the file `~/.emacs' in the current buffer
during the expansion.
2. *Emacs command templates*: The expansion of a command template
evals a template in the same way as an interactive command, which
is invoked with `M-x command'. For example:
^@COMMAND^@ insert-file ^@END COMMAND^@
runs the interactive command `insert-file' during the expansion.
3. *Template comments* Nothing will be evaluated during the expansion
of a template comment. It is only a comment. For example:
^@C^@ This is a comment
The end of the comment is the end of the line. Therefore it has
the same syntax as a lisp or C++ comment.
By default, a template will be deleted after its expansion, but
without the linefeed. Look at the following examples:
Before the expansion:
Line before the template
^@C^@ The Text of a comment template
Line after the template
After the expansion:
Line before the template
Line after the template
Templates can start in any column, and only the template will be
deleted after its expansion.
It is also possible to put an attribute list in a template. The
attributes of the list control the deletion of the template. It may be
that this will be extended in the future with other attributes. The
attribute list must be specified as an alist (assoc list) in the start
tag of a template and after its type. Each element of the alist consists
of the name of the attribute following its value. If no attribute list
is specified or if an attribute is missing, then the default values are
used. At the moment there are the following 2 attributes:
1. *don't delete attribute* (`DONT_DELETE'): If the value is t, then
the template will not be deleted after its expansion. If the value
is nil then the template will be deleted. The default is nil. For